"""Quick test script to verify LLM connection without full dataset."""
import os
from alphasql.llm_call.openai_llm import call_openai

print("Testing LLM connection...")
print(f"Base URL: {os.environ.get('OPENAI_BASE_URL')}")
print(f"API Key set: {'Yes' if os.environ.get('OPENAI_API_KEY') else 'No'}")
print()

try:
    response = call_openai(
        prompt="Hello! Please respond with 'Connection successful' if you receive this message.",
        model="gpt-4o",  # or change to the model name your service uses
        temperature=0.0,
        max_tokens=50,
        n=1
    )
    
    print("\n✓ LLM connection successful!")
    print(f"Response: {response}")
    
except Exception as e:
    print(f"\n✗ LLM connection failed!")
    print(f"Error: {e}")
    import traceback
    traceback.print_exc()
